package com.order.manager.controller.Evaluate;

import com.order.manager.Model.SenderExamineInfo;
import com.order.manager.Model.other.RestBean;
import com.order.manager.service.impl.SenderExamineInfoServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 配送员审核信息控制器
 * 处理配送员审核信息的查询等操作
 */
@RequestMapping("/api/examineSender")
@RestController
public class SenderExamineInfoController {

    @Resource
    SenderExamineInfoServiceImpl senderExamineInfoService;

    @RequestMapping("/examine/{id}")
    public RestBean getSenderExamineById(@PathVariable String id) {
        // 调用服务层方法，根据ID获取配送员审核信息
        SenderExamineInfo byId = senderExamineInfoService.getById(id);

        return byId == null
                ? RestBean.failure(403, "不存在该审核信息")
                : RestBean.success(byId);
    }
}